#pragma once
#include"P3D.h"
#include"Surface.h"
class Triangle3D 
	:public Surface
{
public:
	Triangle3D(P3D a = P3D(), P3D b = P3D(), P3D c = P3D());
	~Triangle3D();
	
	virtual Vector3 GetCenter();
	virtual bool Hit(lzw::Ray ray, float t0, float t1, HitRecord& rec);
	virtual BoundingBox GetBoundingBox();
	
	Vector3 GetFaceNormal();
	Vector3 GetPointNormal();
	Vector3 GetPointNormal(Vector3 p);
	Vector3 GetUVW(Vector3 p);
	Vector2 GetUV(Vector3 p);
	bool HasCommonEdge(Triangle3D T,Vector3* ps); 

	P3D a;
	P3D b;
	P3D c;
	Material mat;
};

